﻿@{
    Layout = "../Shared/_Default.cshtml";
    ViewBag.PageTitle = T(Res.Name("Title"), JDM.Int32(Model.EntityID));
}

@section Breadcrumb
{
    <a href="@Url.Action(Loc.Act("Index").Ctrl("File"))">@T(Res.In("WebAdmin").Of("Navigation").Of("FileSystem").Name("File"))</a> &gt;
}
<section class="box">
    <script type="text/javascript">
        jQuery(document).ready(function() {
            jQuery('@ID("#tabs")').tabs();
            jQuery('@ID("#dlg_download")').dialog();
            jQuery('@ID("#btn_download")').click(function () {
                jQuery('@ID("#dlg_download")').dialog("open");
            });
        });
    </script>
    <header>
        <ul class="bar toolbar">
            <li><a id="@ID("btn_download")" class="button" href="#">@T(Res.Name("Download"))</a></li>
            <li class="item-separator"></li>
            <li><a class="button confirm" href="@Url.Action(Loc.Act("Delete").Ctrl("File").Set(new
            {
                id = JDM.Int32(Model.EntityID)
            }))">@T(Res.In("Common").Of("Act").Name("Delete"))</a></li>
        </ul>
        <h3>@ViewBag.PageTitle</h3>
    </header>
    <section>
        <div id="@ID("tabs")">
            <ul>
                <li><a href="@ID("#tab_1")">*</a></li>
            </ul>
            <div id="@ID("tab_1")">
            @{
                Html.RenderPartial("_Update");
            }
            </div>
        </div>
        <div id="@ID("dlg_download")">
            <script type="text/javascript">
                jQuery(document).ready(function () {
                    jQuery('@ID("#btn_add_tformProperty")').click(function (event) {
                        event.preventDefault();
                        var propNum = jQuery('@ID("#table_tformProperties") tr').length;
                        jQuery('@ID("#table_tformProperties")').append('<tr>' +
                            '<td><input type="text" name="tformProperties[' + propNum + '].Key" /></td>' +
                            '<td><input type="text" name="tformProperties[' + propNum + '].Value" /></td>' +
                            '</tr>');
                    });
                });
            </script>
            <form action="@Url.Action(Loc.Act("Download").Ctrl("File"))" method="get">
                <input type="hidden" name="id" value="@JDM.Int32(Model.EntityID)" />
                <table>
                    <tr>
                        <td><label>Transform</label></td>
                        <td>
                            <select name="tform">
                                <option value="00000000-0000-0000-0000-000000000000">none</option>
                                <option value="52e475b9-a783-489a-8382-c8f34da5366b">GZip</option>
                                @if(MimeTypeHelper.IsImage(JDM.String(Model.MimeType)))
                                {
                                    <option value="d15452ad-1e6f-492a-b2e2-dbce11bcb4ec">Image resize</option>
                                    <option value="f6f3b677-d9b5-4873-a164-47d535a49337">Image watermark</option>
                                }
                            </select>
                        </td>
                    </tr>
                </table>
                <table id="@ID("table_tformProperties")">
                </table>
                <ul class="bar toolbar">
                    <li><button id="@ID("btn_add_tformProperty")" class="button">+</button></li>
                    <li><button class="button" type="submit">@T(Res.Name("Download"))</button></li>
                </ul>
            </form>
        </div>
    </section>
</section>
